import pymysql


def musql_connect(user, host, password, port):
    db = pymysql.connect(host=host, user=user, password=password, port=port, connect_timeout=30)
    cursor = db.cursor()
    cursor.execute("SELECT VERSION()")
    data = cursor.fetchone()
    print("DATASE version:", data)


if __name__ == "__main__":
    musql_connect("xbq", "192.168.186.129", "xbq", 3306)
